package com.xique.door.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xique.door.bean.domain.BuildBuilding;
import com.xique.door.bean.search.build.BuildingListSearch;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 楼栋Mapper接口
 *
 * @author shd
 * @date 2021-09-10
 */
@Repository
public interface BuildBuildingMapper  extends BaseMapper<BuildBuilding>
{
    /**
     * 查询楼栋
     *
     * @param id 楼栋ID
     * @return 楼栋
     */
    public BuildBuilding selectBuildBuildingById(Long id);

    /**
     * 查询楼栋列表
     *
     * @param buildBuilding 楼栋
     * @return 楼栋集合
     */
    public List<BuildBuilding> selectBuildBuildingList(BuildBuilding buildBuilding);

    /**
     * 根据区域id查询楼栋列表
     *
     * @param ids 楼栋
     * @return 楼栋集合
     */
    List<BuildBuilding> selectBuildBuildingListByAreaIds(List<Long> ids);

    /**
     * 根据ids查询楼栋列表
     *
     * @param ids 楼栋
     * @return 楼栋集合
     */
    List<BuildBuilding> selectBuildBuildingListByIds(List<Long> ids);

    /**
     * 新增楼栋
     *
     * @param buildBuilding 楼栋
     * @return 结果
     */
    public int insertBuildBuilding(BuildBuilding buildBuilding);

    /**
     * 修改楼栋
     *
     * @param buildBuilding 楼栋
     * @return 结果
     */
    public int updateBuildBuilding(BuildBuilding buildBuilding);

    /**
     * 删除楼栋
     *
     * @param id 楼栋ID
     * @return 结果
     */
    public int deleteBuildBuildingById(Long id);

    /**
     * 批量删除楼栋
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteBuildBuildingByIds(String[] ids);

    public int countParkBuildingNum(Long parkId);

    public int batchInsertBuildings(List<BuildBuilding> buildBuildings);

    /**
     * 查询楼栋列表
     * @author shd
     * @date 2022/3/8 14:31
     * @param search
     * @return java.util.List<com.xique.door.bean.domain.BuildBuilding>
     */
    List<BuildBuilding> selectBuildBuildingListV1(BuildingListSearch search);

    /**
     * 查询楼栋列表数量
     * @author shd
     * @date 2022/3/8 14:32
     * @param search
     * @return int
     */
    int selectBuildBuildingCountV1(BuildingListSearch search);
}
